from django.db import models
from ckeditor_uploader.fields import RichTextUploadingField


# Create your models here.
class Article(models.Model):
    order = (
        ("雅思", "雅思"),
        ("托福", "托福"),
        ("考研英语", "考研英语"),
        ("CET4/6", "CET4/6"),
        ("TEM4/8", "TEM4/8"),
        ("BEC", "BEC"),
    )
    article_id = models.AutoField(primary_key=True)
    avatar = models.ImageField(upload_to='media', verbose_name="图片", blank=True, )
    classes = models.CharField('板块', choices=order, default="雅思", max_length=50)
    title = models.CharField('标题', max_length=50)
    brief_content = models.TextField('简介')  # 摘要
    content = RichTextUploadingField('内容')
    publish_date = models.DateTimeField('发布时间', auto_now=True)
    top = models.BooleanField('是否置顶', null=False)
    hot = models.BooleanField('热点', null=False)

    class Meta:
        ordering = ('-publish_date',)
        verbose_name = "野子英语文章编辑"
        verbose_name_plural = "野子英语文章编辑"
